﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Metex
{
    public interface IToken
    {
        string Class { get; }
        string Lexeme { get; set; }
        IToken Clone();
    }

    public abstract class CloneableToken : IToken
    {

        public IToken Clone()
        {
            return (IToken)this.MemberwiseClone();
        }

        #region IToken Members

        public abstract string Class
        {
            get;
        }

        public abstract string Lexeme
        {
            get;
            set;
        }

        #endregion
    }


    public class WhitespaceToken : CloneableToken
    {
        public WhitespaceToken()
        {
        }
        public WhitespaceToken(string lexeme)
        {
            this.Lexeme = lexeme;
        }
        public override string Class
        {
            get { return "WirthSymbol"; }
        }

        public override string Lexeme { get; set; }
    }

    public class WirthSymbolToken : CloneableToken
    {
        public WirthSymbolToken()
        {
        }
        public WirthSymbolToken(string lexeme)
        {
            this.Lexeme = lexeme;
        }
        public override string Class
        {
            get { return "WirthSymbol"; }
        }

        public override string Lexeme { get; set; }
    }

    public class TerminalToken : CloneableToken
    {
        public TerminalToken()
        {
        }
        public TerminalToken(string lexeme)
        {
            this.Lexeme = lexeme;
        }

        public override string Class
        {
            get { return "Terminal"; }
        }

        public override string Lexeme { get; set; }
    }

    public class NonTerminalToken : CloneableToken
    {
        public NonTerminalToken()
        {
        }
        public NonTerminalToken(string lexeme)
        {
            this.Lexeme = lexeme;
        }

        public override string Class
        {
            get { return "NonTerminal"; }
        }

        public override string Lexeme { get; set; }
    }

}
